package com.bitland.demo.microservice1.controller;

import com.bitland.demo.microservice1.openfeign.client.FeignTestClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping(value = "/feign")
public class OpenFeignController {
    @Autowired
    FeignTestClient feignTestClient;

    //http://localhost:7001/ms1/feign/hello/lisi
    @GetMapping("hello/{name}")
    public String test(@PathVariable("name") String name) {
        return feignTestClient.test(name);
    }
}
